package demo1;

public class Main {
    public static void main(String[] args) {
        //System.out.println("Hello world!");
        //先尝试梳理封装
        //demo1.Test test = new demo1.Test();
//        test.setName("终是物也成堆");
//        test.getName();
        //封装，并提供接口，finish
        //梳理继承、多态
        //System.out.println(test);
        Status one = new Status();
        System.out.println(one);
    }
}
class Test{
    //玩家角色名
    private String name = "楚留香";
    //玩家游戏职业
    private String character = "舞剑师";
    //玩家等级
    private int grade = 0;
    public Test(String name,String character) {
        this.name = name;
        this.character = character;
    }
    public Test() {

    }

//    public void setName(String name) {
//        this.name = name;
//    }
//    public void getName() {
//        System.out.println("您的角色名为："+this.name);
//    }
}
class Status extends Test{
    //游戏所在区域
    public String city;

    @Override
    public String toString() {
        return "demo1.Status{" +
                "city='" + city + '\'' +
                '}';
    }

    //两种构造方法
    public Status(String name,String character,String city) {
        super(name,character);
        this.city = city;
    }
    public Status() {
        super();
    }
}
//目前对写项目找不到方法，先上课吧
